﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControl_memberContent : System.Web.UI.UserControl
{

    string IndexPage = "~/UserControl/memberProfile.ascx";
    string UpdateProfilePage = "~/UserControl/memberUpdateProfile.ascx";
    string ChangePassPage = "~/UserControl/memberChangePassword.ascx";
    string RegisterPage = "~/UserControl/memberRegister.ascx";
    string ForgotPassPage = "~/UserControl/memberForgotPass.ascx";
    string LoginPage = "~/UserControl/memberLogin.ascx";
    string OrderPage = "~/UserControl/memberDathang.ascx";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["Page"] != null)
        {
            string PageRequest = Request["Page"];

            switch (PageRequest) {
                case "UpdateProfile": pldmemberContent.Controls.Add(Page.LoadControl(UpdateProfilePage));
                    break;
                case "ChangePass": pldmemberContent.Controls.Add(Page.LoadControl(ChangePassPage));
                    break;
                case "Register": pldmemberContent.Controls.Add(Page.LoadControl(RegisterPage)); 
                    break;
                case "ForgotPass": pldmemberContent.Controls.Add(Page.LoadControl(ForgotPassPage)); 
                    break;
                case "Login": pldmemberContent.Controls.Add(Page.LoadControl(LoginPage));
                    break;
                case "Dathang": pldmemberContent.Controls.Add(Page.LoadControl(OrderPage));
                    break;
            }
        }
        else 
        {
            if(Session["memberName"]!=null)
                pldmemberContent.Controls.Add(Page.LoadControl(IndexPage));
            else
                pldmemberContent.Controls.Add(Page.LoadControl(LoginPage));
        }
    }
}